/* --------- */
/* Variables */
/* --------- */

:root {

/* Fonts */
  --ff-sans: -apple-system, BlinkMacSystemFont, "SF Pro", "SF Pro Text", "Helvetica Neue", "Helvetica", "Arial", 
    "Roboto", "Ubuntu", "Segoe UI", "Fira Sans", "Droid Sans", sans-serif;
  --ff-serif: "Ivy Journal", "Adobe Caslon Pro", 
    "Goudy Old Style", "Athelas", "Californian FB", "Georgia Pro", Georgia, serif;
  --ff-disp: "SangBleu Empire", "F37 Bella", "acta-display", 
    "Questa Grande", "QuestaGrande", "Didot", "Didonesque", 
    "Georgia Pro", Georgia, serif;
  --ff-disp-sm: "SangBleu Kingdom", "Questa", "Georgia Pro", Georgia, serif;

  --f-sml:  0.875rem;
  --f-med:  1rem;    
  --f-semi: 1.25rem; 
  --f-lrg:  1.5rem;  
  --f-xlg:  2rem;    
  --f-2xl:  3rem;    
  --f-hero: 3.75rem; 
  --f-xhr:  4.5rem;  
  --f-2xh:  6rem;    

  --f-weight: 400;
  --f-line-height: 1.5;

/* Lengths */

  --unit: 0.625rem;
  --u2: calc(2 * var(--unit) );
  --u3: calc(3 * var(--unit) );
  --u4: calc(4 * var(--unit) );
  --u6: calc(6 * var(--unit) );
  --u8: calc(8 * var(--unit) );

  --content: 70rem;
  --measure: 33em;

/* Colours */

  --grey1: #333;
  --grey2: #5a5a5a;
  --grey3: #b2b2b2;
  --grey4: #d0d0d0;
  --grey5: #f6f6f6;

  --gold-dark: #a58e19;
  --gold-bright: #FFD81E;
  --gold-light: #E5CF67;

}

/* ---- */
/* Base */
/* ---- */

* {
  box-sizing: border-box
}

*:focus {
  background-color: var(--gold-bright);
  box-shadow: 0 0 0 var(--unit) var(--gold-bright);
  outline: none
}

body,h1,h2,h3,h4,h5,h6,p,blockquote,pre,hr,dl,dd,ol,ul,figure {
  margin: 0;
  padding: 0
}

html,body {
  height: 100%
}

html {
  font-size: 14px
}

@media screen and (orientation: portrait) and (min-width: 1024px) {
  html {
    font-size:16px
  }
}
@media screen and (orientation: landscape) and (min-width: 1440px) {
  html {
    font-size:16px
  }
}
@media screen and (min-width: 2000px) {
  html {
    font-size:20px
  }
}
@media screen and (min-width: 2800px) {
  html {
    font-size:24px
  }
}

body {
  font-family: var(--ff-sans);
  line-height: 1.5;
  color: var(--grey1);
  background-color: white;
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "kern" 1,"liga" 1,"calt" 1,"pnum" 1,"tnum" 0,"onum" 1,"lnum" 0,"dlig" 0;
  font-kerning: normal;
  text-rendering: optimizeLegibility
}

img {
  max-width: 100%;
  vertical-align: middle
}

figure>img {
  display: block;
  margin: 0 auto
}

figcaption {
  font-size: var(--f-sml);
  text-align: center
}

h1,h2,h3,h4,blockquote {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale
}

a {
  color: var(--grey2);
  text-decoration: none;
  background-color: transparent;
  background-image: -webkit-linear-gradient(transparent -300%, currentColor 600%);
  background-image: linear-gradient(transparent -300%, currentColor 600%);
  text-decoration: none;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 100%;
  transition: all 0.2s ease-in-out
}

a:hover {
  color: black
}

/* ---------- */
/* Typography */
/* ---------- */

i, em {
  font-style: italic;
}

b, strong {
  font-weight: 600;
}

small {
  font-size: var(--f-sml);
}

big {
  font-size: var(--f-semi)
}

p {
  font-family: var(--ff-serif);
  font-size: 1.25rem;
  line-height: 1.7;
  margin: 1.25em 0;
}

h6, thead {
  font-size: var(--f-sml);
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 0.1em;
  margin: 1.5em 0 1em;
}

h5 {
  font-family: var(--ff-serif);
  font-size: var(--f-semi);
  margin: 1.5em 0 1em;
  font-style: italic;
  font-weight: 400;
}

h5::after {
  content: '—'
}

@media screen and (min-width: 480px) {
  h5 {
    font-size:var(--f-lrg)
  }
}

@media screen and (min-width: 1440px) {
  h4 {
    font-size:var(--f-xlg)
  }
}

h4 {
  font-size: var(--f-lrg);
  line-height: 1.25;
  margin: 1em 0 0.5em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.125em;
}

@media screen and (min-width: 1440px) {
  h4 {
    font-size:var(--f-xlg)
  }
}

@media screen and (min-width: 1024px) {
  h3 {
    font-size:var(--f-xlg)
  }
}

h3 {
  font-family: var(--ff-serif);
  font-size: var(--f-lrg);
  line-height: 1.25;
  margin: 1em 0 0.5em;
  font-weight: 200;
}

@media screen and (min-width: 480px) {
  h3 {
    font-size:var(--f-xlg);
    line-height: 1
  }
}

@media screen and (min-width: 1024px) {
  h3 {
    font-size:var(--f-2xl)
  }
}

@media screen and (min-width: 1440px) {
  h3 {
    font-size:var(--f-hero)
  }
}

h2 {
  font-size: var(--f-xlg);
  line-height: 1.25;
  margin: 1em 0 0.5em;
  font-weight: 200;
  letter-spacing: 0.1em;
}

@media screen and (min-width: 480px) {
  h2 {
    font-size:var(--f-2xl);
    line-height: 1
  }
}

@media screen and (min-width: 1024px) {
  h2 {
    font-size:var(--f-hero);
    font-weight: 100;
  }
}

@media screen and (min-width: 1440px) {
  h2 {
    font-size:var(--f-xhr);
  }
}

h1 {
  font-family: var(--ff-disp-sm);
  font-size: var(--f-xlg);
  line-height: 1.25;
  margin: 1em 0 0.5em;
}

@media screen and (min-width: 480px) {
  h1 {
    font-family: var(--ff-disp);
    font-size:var(--f-hero);
    line-height: 1
    font-weight: 400;
  }
}

@media screen and (min-width: 1024px) {
  h1 {
    font-size:var(--f-xhr);
    letter-spacing: -0.01em;
  }
}

@media screen and (min-width: 1440px) {
  h1 {
    font-size:var(--f-2xh);
    font-weight: 200;
  }
}

/* ------ */
/* Layout */
/* ------ */

#write {
  max-width: var(--content);
  width: 100%;
  margin: 0 auto;
  padding-left: var(--u2);
  padding-right: var(--u2);
}

@media screen and (min-width: 768px) {
  #write {
    padding-left: var(--u4);
    padding-right: var(--u4)
  }
}

p {
  max-width: var(--measure);
}

blockquote {
  font-family: var(--ff-serif);
  font-style: italic;
}

blockquote p {
  font-size: 1.5em;
}

/* Peekout / peekin */

blockquote {
  margin-left: 0;
  margin-right: 0
}

@media screen and (min-width: 1440px) {
  blockquote {
    margin-left: var(--u4);
    margin-right: var(--u4)
  }
}

h5 {
  margin-left: 0;
  margin-right: 0
}

@media screen and (min-width: 1440px) {
  h5 {
    margin-left: calc(-1 * var(--u4));
    margin-right: calc(-1 * var(--u4))
  }
}

ul, ol {
  max-width: var(--measure);
  margin-left: var(--u4);
}

hr {
  margin: var(--u8) 0;
}

table {
  margin: var(--u4) 0;
}

pre, .CodeMirror {
  background-color: var(--grey5);
  padding: var(--unit);
}

#write input[type="checkbox"] {
  margin: 0.75rem 0;
}

img {
  width: 100%;
  height: auto;
}

a.md-toc-inner {
  line-height: 1em;
  margin: 0.5em 0;
}

.footnotes {
  font-size: var(--f-sml);
  padding: var(--u4) 0 1em;
  border-top: 1px solid var(--grey4);
  margin-top: var(--u4);
}

/*Outlines*/

.outline-content {
  padding: 0.5em var(--u2);
}

.outline-h2 > .outline-item {
  padding-left: var(--unit);
}
.outline-h3 > .outline-item {
  padding-left: var(--u2);
}
.outline-h4 > .outline-item {
  padding-left: var(--u3);
}

.outline-item {
  padding-top: 0.5em;
  padding-bottom: 0.5em;
}

/*Sidebar*/

.info-panel-tab-wrapper {
  font-family: var(--ff-sans);
}

.active-tab-files #info-panel-tab-file .info-panel-tab-border,
.active-tab-outline #info-panel-tab-outline .info-panel-tab-border {
  height: 1px;
}

/*Megamenu*/

.megamenu-menu a,
.dropdown a {
  background-image: none;
}

.megamenu-menu ul, .megamenu-menu ol,
.dropdown ul, .dropdownol {
  list-style: none;
  margin-left: 0;
}

.megamenu-menu-list li a {
  display: inline-block;
  width: 100%;
  padding-top: var(--u2);
  padding-bottom: var(--u2);
  position: relative;
  font-size: var(--f-med);
}

.megamenu-menu-list li a span {
  position: absolute;
  top: 0;
}

.megamenu-menu-panel h1 {
  font-family: var(--ff-sans);
  font-size: var(--f-2xl);
  font-weight: 400;
  line-height: 1em;
  letter-spacing: 0.05em;
}

@media screen and (min-width: 768px) {
  .megamenu-menu-panel h1 {
    font-family: var(--ff-sans);
    font-size: var(--f-hero);
    font-weight: 200;
    line-height: 1em;
    letter-spacing: 0.1em;
  }
}

.megamenu-menu-panel {
  max-width: var(--content);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--u4);
}

/*Form elements*/

input:focus, button:focus, select:focus, textarea:focus {
  background-color: white;
  outline: var(--unit) var(--gold-bright);
}

/*Notifications*/

#md-notification {
  border: none;
  max-width: var(--measure);
  color: black;
  box-shadow: 0 0 0 1px;
  padding: var(--u2) 0;
  left: auto;
  right: var(--u2);
}

.typora-node.pin-outline #md-searchpanel,
.typora-node.pin-outline #md-notification {
  left: auto;
}

#md-notification p {
  font-family: var(--ff-sans);
  text-align: left;
}

/*Source*/

#typora-source *:focus {
  background-color: white;
}
